#pragma once
#include "stdafx.h"

class CTimer
{
public:
	CTimer(void);

	void				Start();
	void				Stop();
	void				Update();

	BOOL				IsStopped()  { return g_timerStopped; }

	float				GetFPS() { return g_fps; }
	float				GetRunningTime() { return g_runningTime; }
	float				GetElapsedTime() { return g_timerStopped ? 0.0f : g_timeElapsed; }

private:
	INT64				g_ticksPerSecond;
	INT64				g_currentTime;
	INT64				g_lastTime;
	INT64				g_lastFPSUpdate;
	INT64				g_FPSUpdateInterval;
	UINT				g_numFrames;
	float				g_runningTime;
	float				g_timeElapsed;
	float				g_fps;
	BOOL				g_timerStopped;
};

